package guoanmaker.provider.business.repository;

import java.util.Collection;
import java.util.List;
import java.util.Optional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;



import guoanmaker.provider.business.model.ProvideCity;
import guoanmaker.provider.business.model.ProviderProvince;

public interface ProvideCityRepository extends JpaRepository<ProvideCity, String>, JpaSpecificationExecutor<ProvideCity> {
	  @Query("select u from ProvideCity u where u.provincecode=:provincecode")
	  public List<ProvideCity> findBycode(@Param("provincecode") String provincecode);
	  
	  
	  List<ProvideCity> findByCodeIn(Collection<String> codes);
	  
	  //通过城市code查询城市
	  public ProvideCity findByCode(String code);
	  
	  @Query("select u from ProvideCity u where u.code=:code")
	  ProvideCity findIdBycode(@Param("code") String code);
	  
	  
}
